﻿using System.Collections.Generic;
using System.Web;
using System.Web.Optimization;

namespace webMvc
{
	internal class AsIsBundleOrderer : IBundleOrderer
	{
		public virtual IEnumerable<BundleFile> OrderFiles(BundleContext context, IEnumerable<BundleFile> files)
		{
			return files;
		}
	}
	public class BundleConfig
	{
		// 有关捆绑的详细信息，请访问 https://go.microsoft.com/fwlink/?LinkId=301862
		public static void RegisterBundles(BundleCollection bundles)
		{

			BundleTable.EnableOptimizations = false;

			bundles.IgnoreList.Clear();

			//Bootstrap基础样式
			bundles.Add(new StyleBundle("~/bundles/baseBootstrapCss").Include("~/Content/static/css/bootstrap.min.css", "~/Content/static/css/font-awesome.css"));
			
			//bootstrap-table 表格插件样式
			bundles.Add(new StyleBundle("~/bundles/BootstrapTableCss").Include("~/Content/static/ajax/libs/bootstrap-table/bootstrap-table.min.css", "~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.css", "~/Content/static/css/animate.css", "~/Content/static/css/style.css", "~/Content/static/css/checkbox.css"));

			//基础js插件
			bundles.Add(new ScriptBundle("~/bundles/basejs") { Orderer = new AsIsBundleOrderer() }.Include("~/Content/static/js/jquery.min.js",
				"~/Content/static/js/bootstrap.min.js",
				"~/Content/static/ajax/libs/layer/layer.min.js",
				"~/Content/static/ruoyi/js/common*",
				"~/Content/static/ruoyi/js/ry-ui*"));

			//bootstrap-table 表格js插件
			bundles.Add(new ScriptBundle("~/bundles/bootstraptablejs") { Orderer = new AsIsBundleOrderer() }.Include(
				"~/Content/static/ajax/libs/bootstrap-table/bootstrap-table.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"));


			//jquery-validate 表单验证插件
			bundles.Add(new ScriptBundle("~/bundles/jqueryValidate") { Orderer = new AsIsBundleOrderer() }.Include(
				"~/Content/static/ajax/libs/validate/jquery.validate.min.js",
				"~/Content/static/ajax/libs/validate/messages_zh.min.js",
				"~/Content/static/ajax/libs/validate/jquery.validate.extend.js"
			));

			//jquery-treegrid 表单树插件
			bundles.Add(new ScriptBundle("~/bundles/treegridjs") { Orderer = new AsIsBundleOrderer() }.Include(
				"~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.min.js",
				"~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.extension.js"));

			//jquery-export 表格导出插件
			bundles.Add(new ScriptBundle("~/bundles/jqueryexportjs") { Orderer = new AsIsBundleOrderer() }.Include(
				"~/Content/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js"));


			bundles.Add(new StyleBundle("~/bundles/ryTable").Include("~/Content/static/css/bootstrap.min.css", "~/Content/static/css/font-awesome.css", "~/Content/static/ajax/libs/bootstrap-table/bootstrap-table.min.css", "~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.css", "~/Content/static/css/animate.css", "~/Content/static/css/style.css", "~/Content/static/css/checkbox.css", "~/Content/static/ruoyi/css/RuoYi.css", "~/Content/static/ajax/libs/jquery-layout/jquery.layout-latest.css", "~/Content/static/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css"));

			bundles.Add(new ScriptBundle("~/bundles/tytablejs") { Orderer = new AsIsBundleOrderer() }.Include("~/Content/static/js/jquery.min.js",
				"~/Content/static/js/bootstrap.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/bootstrap-table.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js",
				"~/Content/static/ajax/libs/validate/jquery.validate.min.js",
				"~/Content/static/ajax/libs/validate/messages_zh.min.js",
				"~/Content/static/ajax/libs/validate/jquery.validate.extend.js",
				"~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.min.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js",
				"~/Content/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js",
				"~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.min.js",
				"~/Content/static/ajax/libs/jqTreeGrid/jquery.treegrid.extension.js",
				"~/Content/static/ajax/libs/layer/layer.min.js",
				"~/Content/static/ruoyi/js/common*",
				"~/Content/static/ruoyi/js/ry-ui*"));


			bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
						"~/Scripts/jquery-{version}.js"));

			bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
						"~/Scripts/jquery.validate*"));

			// 使用要用于开发和学习的 Modernizr 的开发版本。然后，当你做好
			// 生产准备就绪，请使用 https://modernizr.com 上的生成工具仅选择所需的测试。
			bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
						"~/Scripts/modernizr-*"));

			bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
					  "~/Scripts/bootstrap.js",
					  "~/Scripts/respond.js"));

			bundles.Add(new StyleBundle("~/Content/css").Include(
					  "~/Content/bootstrap.css",
					  "~/Content/site.css"));
		}
	}
}
